﻿using System;
using System.Collections.Generic;
using System.Text;
using Pixysoft.Tools;

namespace Pixysoft.Weblications.Sango.Formular
{
    class QueueFormular
    {
        public const int default_queue_enddate = -1;

        /// <summary>
        /// 队列冷却花费
        /// </summary>
        /// <param name="usrQueue"></param>
        /// <param name="sysQueue"></param>
        /// <returns></returns>
        public static int getQueueCooldownGoldPrice(Pixysoft.Weblications.Sango.Entities.Usr_Queue usrQueue, Pixysoft.Weblications.Sango.Entities.Sys_Queue sysQueue)
        {
            double timespan = usrQueue.Queueenddate - GlobalTimer.Instance.ToTimeSequence();

            if (timespan <= 0)
                return 0;

            return (int)Math.Ceiling(timespan / 1000 / 60 * sysQueue.Cooldowngoldprice);
        }
    }
}
